package com.lmiot.xyclick.Bean.SQL;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.internal.DaoConfig;

public class FriendBeanDao extends AbstractDao<FriendBean, Long> {
    public static final String TABLENAME = "FRIEND_BEAN";

    public static class Properties {
        public static final Property Detail = new Property(5, String.class, "detail", false, "DETAIL");
        public static final Property GroupID = new Property(6, String.class, "groupID", false, "GROUP_ID");
        public static final Property GroupName = new Property(7, String.class, "groupName", false, "GROUP_NAME");
        public static final Property Id = new Property(0, Long.class, "id", true, "_id");
        public static final Property UserBrand = new Property(3, String.class, "userBrand", false, "USER_BRAND");
        public static final Property UserID = new Property(1, String.class, "userID", false, "USER_ID");
        public static final Property UserModel = new Property(4, String.class, "userModel", false, "USER_MODEL");
        public static final Property UserName = new Property(2, String.class, "userName", false, "USER_NAME");
    }

    /* access modifiers changed from: protected */
    @Override // org.greenrobot.greendao.AbstractDao
    public final boolean isEntityUpdateable() {
        return true;
    }

    public FriendBeanDao(DaoConfig daoConfig) {
        super(daoConfig);
    }

    public FriendBeanDao(DaoConfig daoConfig, DaoSession daoSession) {
        super(daoConfig, daoSession);
    }

    public static void createTable(Database database, boolean z) {
        String str = z ? "IF NOT EXISTS " : "";
        database.execSQL("CREATE TABLE " + str + "\"FRIEND_BEAN\" (\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,\"USER_ID\" TEXT UNIQUE ,\"USER_NAME\" TEXT,\"USER_BRAND\" TEXT,\"USER_MODEL\" TEXT,\"DETAIL\" TEXT,\"GROUP_ID\" TEXT,\"GROUP_NAME\" TEXT);");
    }

    public static void dropTable(Database database, boolean z) {
        StringBuilder sb = new StringBuilder();
        sb.append("DROP TABLE ");
        sb.append(z ? "IF EXISTS " : "");
        sb.append("\"FRIEND_BEAN\"");
        database.execSQL(sb.toString());
    }

    /* access modifiers changed from: protected */
    public final void bindValues(DatabaseStatement databaseStatement, FriendBean friendBean) {
        databaseStatement.clearBindings();
        Long id = friendBean.getId();
        if (id != null) {
            databaseStatement.bindLong(1, id.longValue());
        }
        String userID = friendBean.getUserID();
        if (userID != null) {
            databaseStatement.bindString(2, userID);
        }
        String userName = friendBean.getUserName();
        if (userName != null) {
            databaseStatement.bindString(3, userName);
        }
        String userBrand = friendBean.getUserBrand();
        if (userBrand != null) {
            databaseStatement.bindString(4, userBrand);
        }
        String userModel = friendBean.getUserModel();
        if (userModel != null) {
            databaseStatement.bindString(5, userModel);
        }
        String detail = friendBean.getDetail();
        if (detail != null) {
            databaseStatement.bindString(6, detail);
        }
        String groupID = friendBean.getGroupID();
        if (groupID != null) {
            databaseStatement.bindString(7, groupID);
        }
        String groupName = friendBean.getGroupName();
        if (groupName != null) {
            databaseStatement.bindString(8, groupName);
        }
    }

    /* access modifiers changed from: protected */
    public final void bindValues(SQLiteStatement sQLiteStatement, FriendBean friendBean) {
        sQLiteStatement.clearBindings();
        Long id = friendBean.getId();
        if (id != null) {
            sQLiteStatement.bindLong(1, id.longValue());
        }
        String userID = friendBean.getUserID();
        if (userID != null) {
            sQLiteStatement.bindString(2, userID);
        }
        String userName = friendBean.getUserName();
        if (userName != null) {
            sQLiteStatement.bindString(3, userName);
        }
        String userBrand = friendBean.getUserBrand();
        if (userBrand != null) {
            sQLiteStatement.bindString(4, userBrand);
        }
        String userModel = friendBean.getUserModel();
        if (userModel != null) {
            sQLiteStatement.bindString(5, userModel);
        }
        String detail = friendBean.getDetail();
        if (detail != null) {
            sQLiteStatement.bindString(6, detail);
        }
        String groupID = friendBean.getGroupID();
        if (groupID != null) {
            sQLiteStatement.bindString(7, groupID);
        }
        String groupName = friendBean.getGroupName();
        if (groupName != null) {
            sQLiteStatement.bindString(8, groupName);
        }
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public Long readKey(Cursor cursor, int i) {
        int i2 = i + 0;
        if (cursor.isNull(i2)) {
            return null;
        }
        return Long.valueOf(cursor.getLong(i2));
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public FriendBean readEntity(Cursor cursor, int i) {
        int i2 = i + 0;
        Long valueOf = cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2));
        int i3 = i + 1;
        String string = cursor.isNull(i3) ? null : cursor.getString(i3);
        int i4 = i + 2;
        String string2 = cursor.isNull(i4) ? null : cursor.getString(i4);
        int i5 = i + 3;
        String string3 = cursor.isNull(i5) ? null : cursor.getString(i5);
        int i6 = i + 4;
        String string4 = cursor.isNull(i6) ? null : cursor.getString(i6);
        int i7 = i + 5;
        String string5 = cursor.isNull(i7) ? null : cursor.getString(i7);
        int i8 = i + 6;
        int i9 = i + 7;
        return new FriendBean(valueOf, string, string2, string3, string4, string5, cursor.isNull(i8) ? null : cursor.getString(i8), cursor.isNull(i9) ? null : cursor.getString(i9));
    }

    public void readEntity(Cursor cursor, FriendBean friendBean, int i) {
        int i2 = i + 0;
        String str = null;
        friendBean.setId(cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2)));
        int i3 = i + 1;
        friendBean.setUserID(cursor.isNull(i3) ? null : cursor.getString(i3));
        int i4 = i + 2;
        friendBean.setUserName(cursor.isNull(i4) ? null : cursor.getString(i4));
        int i5 = i + 3;
        friendBean.setUserBrand(cursor.isNull(i5) ? null : cursor.getString(i5));
        int i6 = i + 4;
        friendBean.setUserModel(cursor.isNull(i6) ? null : cursor.getString(i6));
        int i7 = i + 5;
        friendBean.setDetail(cursor.isNull(i7) ? null : cursor.getString(i7));
        int i8 = i + 6;
        friendBean.setGroupID(cursor.isNull(i8) ? null : cursor.getString(i8));
        int i9 = i + 7;
        if (!cursor.isNull(i9)) {
            str = cursor.getString(i9);
        }
        friendBean.setGroupName(str);
    }

    /* access modifiers changed from: protected */
    public final Long updateKeyAfterInsert(FriendBean friendBean, long j) {
        friendBean.setId(Long.valueOf(j));
        return Long.valueOf(j);
    }

    public Long getKey(FriendBean friendBean) {
        if (friendBean != null) {
            return friendBean.getId();
        }
        return null;
    }

    public boolean hasKey(FriendBean friendBean) {
        return friendBean.getId() != null;
    }
}
